package com.xuetang9.service.ls.impl;

import com.xuetang9.dao.PoleMapper;
import com.xuetang9.domain.Pole;
import com.xuetang9.service.ls.PoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @description: 杆塔管理业务的实现
 * @author: 可爱的李四
 * @createTime: 2020/5/13 9:29
 * @version: 1.0.0
 * @place: 公司
 * @copyright: 老九学堂
 */
@Service
public class PoleServiceImpl implements PoleService {

    // 创建操作Pole表的对象
    @Autowired
    PoleMapper poleMapper;

    @Override
    public int insertPole(Pole pole) {
        return poleMapper.insertPole(pole);
    }

    @Override
    public int deletePole(String poleId) {
        return poleMapper.deletePole(poleId);
    }

    @Override
    public int updatePole(Pole pole) {
        return poleMapper.updatePole(pole);
    }

    @Override
    public Pole selectPoleByPoleId(String poleId) {
        return poleMapper.selectPoleByPoleId(poleId);
    }

    @Override
    public List<Pole> selectPoleByAddress(String poleAddress) {
        return poleMapper.selectPoleByAddress(poleAddress);
    }

    @Override
    public List<Pole> selectPoleByStatus(String poleStatus) {
        return poleMapper.selectPoleByStatus(poleStatus);
    }

    @Override
    public Pole selectByPole(Pole pole) {
        return poleMapper.selectByPole(pole);
    }

    @Override
    public List<Pole> selectAll() {
        return poleMapper.listPole();
    }
}
